//查询
function edit(id) {
    var coin = $("#search_coin").val();
    if (!coin) {
        coin = 'meeni';
    }
    $.ajax({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        },
        url: '/assets/groupRedPackDetail',
        data: {id: id, coin: coin},
        type: 'POST',
        error: function (e) {
            if (e.readyState === 4 && e.status === 422) {
                for (var i in e.responseJSON) {
                    if (e.responseJSON[i] !== 'The given data was invalid.') {
                        err = e.responseJSON[i];
                        for (var j in err) {
                            toasterror(err[j][0]);
                        }
                    }
                }
            }
        },
        success: function (data) {
            $('.group_red_detail').html('');
            detail(data);

        }
    })
}

//
function detail(data) {
    var arr = '<tr  class="even"><td>&nbsp;</td></tr><tr class="even"><td>编号</td><td>用户CMID</td><td>用户昵称</td><td>用户手机</td><td>领取金额</td><td>领取时间</td><td>到账时间</td></tr>';
    $.each(data, function (name, value) {

        arr = arr + '<tr  class="even"><td>' + value.id + '</td><td>' + value.user_cmid + '</td> <td>' + value.user_name + '</td><td>' + value.user_mobile + '</td><td>' + value.number + '</td><td>' + value.created_at + '</td><td>' + value.updated_at + '</td></tr>';
    });
    $('.group_red_detail').append(arr);

}